import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 教练服务信息 */
export interface CoachService {
          id: number; // ID
          coachId?: number; // 教练ID
          servicePId?: number; // 授权服务分类ID（服务一级分类ID）
          serviceId?: number; // 授权服务分类ID（服务二级分类ID）
  }

// 教练服务 API
export const CoachServiceApi = {
  // 查询教练服务分页
  getCoachServicePage: async (params: any) => {
    return await request.get({ url: `/business/coach-service/page`, params })
  },

  // 查询教练服务详情
  getCoachService: async (id: number) => {
    return await request.get({ url: `/business/coach-service/get?id=` + id })
  },

  // 新增教练服务
  createCoachService: async (data: CoachService) => {
    return await request.post({ url: `/business/coach-service/create`, data })
  },

  // 修改教练服务
  updateCoachService: async (data: CoachService) => {
    return await request.put({ url: `/business/coach-service/update`, data })
  },

  // 删除教练服务
  deleteCoachService: async (id: number) => {
    return await request.delete({ url: `/business/coach-service/delete?id=` + id })
  },

  /** 批量删除教练服务 */
  deleteCoachServiceList: async (ids: number[]) => {
    return await request.delete({ url: `/business/coach-service/delete-list?ids=${ids.join(',')}` })
  },

  // 导出教练服务 Excel
  exportCoachService: async (params) => {
    return await request.download({ url: `/business/coach-service/export-excel`, params })
  },
}